package com.silver.weibo.server.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.silver.weibo.dao.AttentionMapper;
import com.silver.weibo.entity.Attention;
import com.silver.weibo.entity.dto.MyAttentionDTO;
import com.silver.weibo.entity.vo.MyAttentionVO;
import com.silver.weibo.server.AttentionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class AttentionServiceImpl extends ServiceImpl<AttentionMapper, Attention> implements AttentionService {

    private final AttentionMapper attentionMapper;

    @Autowired
    public AttentionServiceImpl(AttentionMapper attentionMapper) {
        this.attentionMapper = attentionMapper;
    }


    @Override
    public boolean saveAgain(Attention attention) {
        return attentionMapper.saveAgain(attention);
    }

    @Override
    public Attention selectOneByAttention(Attention attention) {
        return attentionMapper.selectOneByAttention(attention);
    }

    @Override
    public List<MyAttentionVO> selectMyAttentionByUserId(MyAttentionDTO myAttentionDTO) {
        return attentionMapper.selectMyAttentionByUserId(myAttentionDTO);
    }
}
